---@class Battle.AiComposite:Battle.AiBehavior
local AiComposite = Battle.CreateClass("AiComposite",Battle.AiBehavior)
Battle.AiComposite = AiComposite
function AiComposite:addChild(child)
    if not self.children then
        ---@type Battle.AiBehavior[]
        self.children = {}
    end
    table.insert(self.children,child)
    child.parent = self
end

function AiComposite:removeChild(child)
    table.removeByValue(self.children,child)
end
function AiComposite:reset()
    Battle.AiBehavior.reset(self)
    for k,v in pairs(self.children) do
        v:reset()
    end
end
---@return Battle.AiBehavior[]
function AiComposite:getChildren()
    return self.children
end
function AiComposite:setChildren(behaviours)
    self.children = behaviours
end
